function val =isval(a, n)
val =-1;
for i=1:length(a)
    if n == a(i)
        val = 1;
        break;
    end
end